import request from '/@/utils/request.ts';

export function getSysOrgList(params: object) {
	return request({
		url: 'core/sysOrg/page',
		method: 'get',
		params,
	});
}

export function getSysOrgListByParentId(params: object) {
	return request({
		url: 'core/sysOrg/listByParentId',
		method: 'get',
		params,
	});
}

export function addSysOrg(data: object) {
	return request({
		url: 'core/sysOrg/',
		method: 'POST',
		data: data,
	});
}

export function getSysOrgInfo(orgId: any) {
	return request({
		url: `core/sysOrg/${orgId}`,
		method: 'GET',
	});
}

export function editSysOrg(data: object, orgId: any) {
	return request({
		url: `core/sysOrg/${orgId}`,
		method: 'PUT',
		data: data,
	});
}

export function delSysOrg(orgId: any) {
	return request({
		url: `core/sysOrg/${orgId}`,
		method: 'DELETE',
	});
}
